/**
 * package: seeds
 * author: zhaiyujin
 * description:
 */
package seeds

import (
	"huanteng/web/models"
	"huanteng/web/services"
)

func SeedMenu()  {

	menu:=models.Menu{}
	service:=services.MenuService{}
	menu=models.Menu{ParentID:0, URL:"", Name:"TOP", Sequence:0, MenuType:1, Status:1, Code:"TOP", Icon:"", Method:""}
	_ = service.Create(&menu)
	menu=models.Menu{ParentID:1, URL:"", Name:"系统管理", Sequence:1, MenuType:1, Status:1, Code:"Sys", Icon:"lock", Method:"",}
	_ = service.Create(&menu)
	menu=models.Menu{ParentID:2, URL:"/icon", Name:"图标管理", Sequence:1, MenuType:1, Status:1, Code:"icon", Icon:"icon", Method:"",}
	_ = service.Create(&menu)

	menu=models.Menu{ParentID:2, URL:"/admin", Name:"管理员管理", Sequence:1, MenuType:2, Status:1, Code:"admin", Icon:"user", Method:"",}
	_ = service.Create(&menu)
	/*menu=models.Menu{ParentID:4, URL:"/menu/button/admin", Name:"管理员操作", Sequence:1, MenuType:3, Status:1, Code:"adminOperate", Icon:"", Method:"get",OperateType:""}
	_ = service.Create(&menu)*/
	menu=models.Menu{ParentID:4, URL:"/role/:id/set", Name:"分配角色", Sequence:1, MenuType:3, Status:1, Code:"setRole", Icon:"", Method:"post",OperateType:"setadminrole"}
	_ = service.Create(&menu)

	menu=models.Menu{ParentID:4, URL:"/admin/role/:id", Name:"管理员角色", Sequence:1, MenuType:3, Status:1, Code:"adminRole", Icon:"", Method:"get",OperateType:""}
	_ = service.Create(&menu)


	menu=models.Menu{ParentID:2, URL:"/role", Name:"角色管理", Sequence:1, MenuType:2, Status:1, Code:"role", Icon:"tree", Method:"",}
	_ = service.Create(&menu)

	/*menu=models.Menu{ParentID:13, URL:"/menu/button/role", Name:"角色操作", Sequence:1, MenuType:3, Status:1, Code:"roleOperate", Icon:"", Method:"get",OperateType:""}
	_ = service.Create(&menu)*/


	menu=models.Menu{ParentID:12, URL:"/role/:id/menu", Name:"菜单列表", Sequence:1, MenuType:3, Status:1, Code:"roleMenu", Icon:"", Method:"get",OperateType:""}
	_ = service.Create(&menu)
	menu=models.Menu{ParentID:12, URL:"/role/:id/menu", Name:"分配菜单", Sequence:1, MenuType:3, Status:1, Code:"setMenu", Icon:"", Method:"post",OperateType:"setrolemenu"}
	_ = service.Create(&menu)




	menu=models.Menu{ParentID:2, URL:"/menu", Name:"菜单管理", Sequence:1, MenuType:2, Status:1, Code:"menu", Icon:"documentation", Method:"",}
	_ = service.Create(&menu)
	menu=models.Menu{ParentID:20, URL:"/menu/button/:id", Name:"操作按钮", Sequence:1, MenuType:3, Status:1, Code:"menuOperate", Icon:"", Method:"get",}
	_ = service.Create(&menu)






}
